/PROG  PNS0029
/ATTR
OWNER		= MNEDITOR;
COMMENT		= "VE21_4542_4543";
PROG_SIZE	= 3350;
CREATE		= DATE 24-05-23  TIME 15:45:28;
MODIFIED	= DATE 25-06-10  TIME 09:29:34;
FILE_NAME	= PNS0027;
VERSION		= 0;
LINE_COUNT	= 119;
MEMORY_SIZE	= 3810;
PROTECT		= READ_WRITE;
TCD:  STACK_SIZE	= 0,
      TASK_PRIORITY	= 50,
      TIME_SLICE	= 0,
      BUSY_LAMP_OFF	= 0,
      ABORT_REQUEST	= 0,
      PAUSE_REQUEST	= 0;
DEFAULT_GROUP	= 1,*,*,*,*;
CONTROL_CODE	= 00000000 00000000;
/APPL
/MN
   1:  !******************************** ;
   2:  !     COSMA METAL FORMING  ;
   3:  !******************************** ;
   4:  !  LINE: CHINA CHANGSHA ;
   5:  !  ROBOT: R12 ;
   6:  !  PROGRAM: PNS0041 ;
   7:  !  PART:53338597/8598 ;
   8:  !******************************** ;
   9:   ;
  10:  !INITIALIZE ;
  11:  MOVE TO HOME    ;
  12:  R[14:CG SENSETIVE]=90    ;
  13:  R[18:PICK TIME BEFORE]=1    ;
  14:  R[19:DROP TIME BEFORE]=.1    ;
  15:   ;
  16:  !------------------------------- ;
  17:  !BEGINNING OF PROGRAM ;
  18:  CALL PARTDROP    ;
  19:  COL GUARD ADJUST R[14] ;
  20:  UTOOL_NUM=1 ;
  21:  UFRAME_NUM=0 ;
  22:  PAYLOAD[3] ;
  23:  R[5:SPEED]=10    ;
  24:  OVERRIDE=R[5:SPEED] ;
  25:  !INITIATE TO PICK-POUNCE ;
  26:J P[1:MIDDLE] 50% CNT100 ACC100    ;
  27:J P[2:PICK POUNCE] 50% CNT100 ACC100    ;
  28:  R[1:CYCLE TOTAL]=0    ;
  29:  TIMER[1]=RESET ;
  30:  TIMER[1]=START ;
  31:   ;
  32:  LBL[10:TOP OF LOOF] ;
  33:  OVERRIDE=R[5:SPEED] ;
  34:   ;
  35:  TIMER[3]=STOP ;
  36:  TIMER[2]=STOP ;
  37:  R[1:CYCLE TOTAL]=R[1:CYCLE TOTAL]+1    ;
  38:  R[2:LAST CYCLE TIME]=TIMER[2]    ;
  39:  R[3:LAST SPM]=60/R[2:LAST CYCLE TIME]    ;
  40:  R[8:R MOVE TIME]=TIMER[3]    ;
  41:  TIMER[2]=RESET ;
  42:  TIMER[2]=START ;
  43:  TIMER[3]=RESET ;
  44:   ;
  45:  !PROCEED TO PICK ;
  46:  LBL[20] ;
  47:  IF DI[1:P1 PICK ENTRY OK]=ON AND DI[3:FROM RL1 CLEAR]=ON AND DI[8:P1 PICK START]=ON,JMP LBL[25] ;
  48:  IF DI[29:CYCLE STOP]=ON,JMP LBL[90] ;
  49:  JMP LBL[20] ;
  50:   ;
  51:  LBL[25] ;
  52:  WAIT DI[1:P1 PICK ENTRY OK]=ON AND DI[3:FROM RL1 CLEAR]=ON AND DI[8:P1 PICK START]=ON    ;
  53:  R[5:SPEED]=100    ;
  54:  TIMER[3]=START ;
  55:  OVERRIDE=R[5:SPEED] ;
  56:J P[3:PICK APPROACH] 100% CNT30 ACC100    ;
  57:   ;
  58:J P[4:PICK] 100% CNT0 TB R[18]sec,CALL PARTPICK ACC100 BREAK    ;
  59:  PAYLOAD[4] ;
  60:  CALL CHK_PICK    ;
  61:  MONITOR Z_CHECH ;
  62:J P[5:PICK DEPART] 100% CNT60 ACC100    ;
  63:  LBL[27] ;
  64:  CALL CHECKPICK    ;
  65:  IF DI[9:VACUUM ON L]=OFF OR DI[11:VACUUM ON R]=OFF,JMP LBL[27] ;
  66:   ;
  67:J P[7:PICK CLEAR] 100% CNT100 ACC100    ;
  68:  DO[5:TO RL1 DROP START]=PULSE,1.0sec ;
  69:  DO[8:P1 PARTS OUT]=PULSE,1.0sec ;
  70:  LBL[30:GOTO DROP POUNCE] ;
  71:J P[8:DROP POUNCE] 100% CNT100 ACC110 BREAK    ;
  72:   ;
  73:  TIMER[3]=STOP ;
  74:  LBL[40:AT DROP POUNCE] ;
  75:  IF DI[2:P2 DROP ENTRY]=ON AND DI[4:FROM R23 CLEAR]=ON AND DI[5:P2 DROP START]=ON,JMP LBL[80] ;
  76:  IF DI[7:PRESS STAMPING COMPLETE]=ON AND DI[2:P2 DROP ENTRY]=ON,JMP LBL[50] ;
  77:  IF DI[18:MOVE TO CLEAR POS]=ON,JMP LBL[60] ;
  78:  JMP LBL[40] ;
  79:   ;
  80:  LBL[50:MOVE DROP SNEAK] ;
  81:  TIMER[3]=START ;
  82:  OVERRIDE=R[5:SPEED] ;
  83:J P[9:DROP SNEAK] 100% CNT100 ACC100 BREAK    ;
  84:  LBL[51:DROP OR C-P-S] ;
  85:  IF DI[2:P2 DROP ENTRY]=ON AND DI[4:FROM R23 CLEAR]=ON AND DI[5:P2 DROP START]=ON,JMP LBL[80] ;
  86:  IF DI[18:MOVE TO CLEAR POS]=ON,JMP LBL[40] ;
  87:  JMP LBL[51] ;
  88:  JMP LBL[50] ;
  89:   ;
  90:  LBL[60:MOVE CLS-PRS-ACC] ;
  91:J P[1:MIDDLE] 50% CNT100 ACC100    ;
  92:  PAUSE ;
  93:  JMP LBL[30] ;
  94:   ;
  95:  LBL[80:DROP ENABLED] ;
  96:  TIMER[3]=START ;
  97:  !PROCEED TO DROP ;
  98:  OVERRIDE=R[5:SPEED] ;
  99:J P[10:DROP APPROACH] 100% CNT70 ACC100    ;
 100:  MONITOR END Z_CHECH ;
 101:J P[11:DROP] 100% CNT5 TB R[19]sec,CALL PARTDROP ACC100    ;
 102:  PAYLOAD[3] ;
 103:  CALL CHK_DROP    ;
 104:   ;
 105:J P[12:DROP DEPART] 100% CNT100 ACC130    ;
 106:J P[13:DROP CLEAR] 100% CNT100 ACC130    ;
 107:  DO[6:PART DROP COMPLETE]=PULSE,1.0sec ;
 108:  !GOTO PICK POUNCE ;
 109:J P[2:PICK POUNCE] 100% CNT100 ACC100 BREAK    ;
 110:  IF DI[29:CYCLE STOP]=ON,JMP LBL[90] ;
 111:  JMP LBL[10] ;
 112:   ;
 113:  LBL[90:END OF CYCLE] ;
 114:  TIMER[1]=STOP ;
 115:  R[4:TOTAL CYCLE TIME]=TIMER[1]    ;
 116:J P[1:MIDDLE] 50% CNT100    ;
 117:  MOVE TO HOME    ;
 118:   ;
 119:  LBL[100:END OF PROGRAM] ;
/POS
P[1:"MIDDLE"]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 1',
	X =  2086.455  mm,	Y =     -.008  mm,	Z = -1279.800  mm,
	W =   180.000 deg,	P =     -.000 deg,	R =  -180.000 deg,
	E1=   107.700 deg
};
P[2:"PICK POUNCE"]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 0',
	X =  2232.711  mm,	Y =  1503.681  mm,	Z =  -945.016  mm,
	W =   179.286 deg,	P =     -.094 deg,	R =   121.002 deg,
	E1=   125.212 deg
};
P[3:"PICK APPROACH"]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 0',
	X =  2257.754  mm,	Y =  3289.734  mm,	Z =  -941.441  mm,
	W =   179.178 deg,	P =     -.176 deg,	R =    91.493 deg,
	E1=   103.911 deg
};
P[4:"PICK"]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 0',
	X =  2257.713  mm,	Y =  3289.734  mm,	Z = -1126.511  mm,
	W =   179.178 deg,	P =     -.176 deg,	R =    91.495 deg,
	E1=   103.911 deg
};
P[5:"PICK DEPART"]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 0',
	X =  2257.754  mm,	Y =  3289.734  mm,	Z =  -933.281  mm,
	W =   179.178 deg,	P =     -.176 deg,	R =    91.493 deg,
	E1=   103.911 deg
};
P[7:"PICK CLEAR"]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 0',
	X =  2114.989  mm,	Y =  1646.021  mm,	Z =  -954.847  mm,
	W =   179.084 deg,	P =      .126 deg,	R =   143.239 deg,
	E1=   141.723 deg
};
P[8:"DROP POUNCE"]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 1',
	X =  2071.726  mm,	Y = -1168.562  mm,	Z =  -988.000  mm,
	W =   179.921 deg,	P =      .670 deg,	R =  -154.212 deg,
	E1=    79.082 deg
};
P[9:"DROP SNEAK"]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 1',
	X =  2372.299  mm,	Y = -1899.088  mm,	Z =  -953.190  mm,
	W =  -179.695 deg,	P =      .457 deg,	R =  -116.322 deg,
	E1=    91.239 deg
};
P[10:"DROP APPROACH"]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 1',
	X =  2712.030  mm,	Y = -3227.904  mm,	Z = -1020.815  mm,
	W =  -179.620 deg,	P =     -.463 deg,	R =   -82.598 deg,
	E1=    99.789 deg
};
P[11:"DROP"]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 1',
	X =  2714.762  mm,	Y = -3227.915  mm,	Z = -1102.163  mm,
	W =  -179.620 deg,	P =     -.463 deg,	R =   -82.598 deg,
	E1=    99.789 deg
};
P[12:"DROP DEPART"]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 1',
	X =  2712.030  mm,	Y = -3227.904  mm,	Z = -1020.815  mm,
	W =  -179.620 deg,	P =     -.463 deg,	R =   -82.598 deg,
	E1=    99.789 deg
};
P[13:"DROP CLEAR"]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 1',
	X =  2127.167  mm,	Y = -1614.750  mm,	Z = -1048.262  mm,
	W =   179.971 deg,	P =      .648 deg,	R =  -143.938 deg,
	E1=    68.927 deg
};
/END
